import axios from "axios"
const console = "http://localhost:7878"
export const getAll = async()=>{
    let res = await axios.get(`${console}/books`)
    return res.data
}
export const getById= async(id)=>{
    let res = await axios.get(`${console}/books/${id}`)
    return res.data
}
export const itemAdd= async(obj)=>{
    let res = await axios.post(`${console}/books`,obj)
    return res.data
}
export const itemCha= async(obj)=>{
    let res = await axios.put(`${console}/books/`,obj)
    
    
    return res.data
}
export const itemDel= async(id)=>{
    let res = await axios.delete(`${console}/books/${id}`)
    
    return res.data
}